home *** CD-ROM | disk | FTP | other *** search
- <refentry id="libgimp-gimptexttool" revision="19 Jan 2001">
- <refmeta>
- <refentrytitle>gimptexttool</refentrytitle>
- <manvolnum>3</manvolnum>
- <refmiscinfo>LIBGIMP Library</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>gimptexttool</refname><refpurpose></refpurpose>
- </refnamediv>
-
- <refsynopsisdiv><title>Synopsis</title>
- <synopsis>
-
-
-
- <link linkend="gint32">gint32</link> <link linkend="gimp-text-fontname">gimp_text_fontname</link> (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint32">gint32</link> drawable_ID,
- <link linkend="gdouble">gdouble</link> x,
- <link linkend="gdouble">gdouble</link> y,
- <link linkend="gchar">gchar</link> *text,
- <link linkend="gint">gint</link> border,
- <link linkend="gboolean">gboolean</link> antialias,
- <link linkend="gdouble">gdouble</link> size,
- <link linkend="GimpSizeType">GimpSizeType</link> size_type,
- <link linkend="gchar">gchar</link> *fontname);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-text-get-extents-fontname">gimp_text_get_extents_fontname</link> (<link linkend="gchar">gchar</link> *text,
- <link linkend="gdouble">gdouble</link> size,
- <link linkend="GimpSizeType">GimpSizeType</link> size_type,
- <link linkend="gchar">gchar</link> *fontname,
- <link linkend="gint">gint</link> *width,
- <link linkend="gint">gint</link> *height,
- <link linkend="gint">gint</link> *ascent,
- <link linkend="gint">gint</link> *descent);
- <link linkend="gint32">gint32</link> <link linkend="gimp-text">gimp_text</link> (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint32">gint32</link> drawable_ID,
- <link linkend="gdouble">gdouble</link> x,
- <link linkend="gdouble">gdouble</link> y,
- <link linkend="gchar">gchar</link> *text,
- <link linkend="gint">gint</link> border,
- <link linkend="gboolean">gboolean</link> antialias,
- <link linkend="gdouble">gdouble</link> size,
- <link linkend="GimpSizeType">GimpSizeType</link> size_type,
- <link linkend="gchar">gchar</link> *foundry,
- <link linkend="gchar">gchar</link> *family,
- <link linkend="gchar">gchar</link> *weight,
- <link linkend="gchar">gchar</link> *slant,
- <link linkend="gchar">gchar</link> *set_width,
- <link linkend="gchar">gchar</link> *spacing,
- <link linkend="gchar">gchar</link> *registry,
- <link linkend="gchar">gchar</link> *encoding);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-text-get-extents">gimp_text_get_extents</link> (<link linkend="gchar">gchar</link> *text,
- <link linkend="gdouble">gdouble</link> size,
- <link linkend="GimpSizeType">GimpSizeType</link> size_type,
- <link linkend="gchar">gchar</link> *foundry,
- <link linkend="gchar">gchar</link> *family,
- <link linkend="gchar">gchar</link> *weight,
- <link linkend="gchar">gchar</link> *slant,
- <link linkend="gchar">gchar</link> *set_width,
- <link linkend="gchar">gchar</link> *spacing,
- <link linkend="gchar">gchar</link> *registry,
- <link linkend="gchar">gchar</link> *encoding,
- <link linkend="gint">gint</link> *width,
- <link linkend="gint">gint</link> *height,
- <link linkend="gint">gint</link> *ascent,
- <link linkend="gint">gint</link> *descent);
- </synopsis>
- </refsynopsisdiv>
-
-
-
-
-
- <refsect1>
- <title>Description</title>
- <para>
-
- </para>
- </refsect1>
-
- <refsect1>
- <title>Details</title>
- <refsect2>
- <title><anchor id="gimp-text-fontname">gimp_text_fontname ()</title>
- <programlisting><link linkend="gint32">gint32</link> gimp_text_fontname (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint32">gint32</link> drawable_ID,
- <link linkend="gdouble">gdouble</link> x,
- <link linkend="gdouble">gdouble</link> y,
- <link linkend="gchar">gchar</link> *text,
- <link linkend="gint">gint</link> border,
- <link linkend="gboolean">gboolean</link> antialias,
- <link linkend="gdouble">gdouble</link> size,
- <link linkend="GimpSizeType">GimpSizeType</link> size_type,
- <link linkend="gchar">gchar</link> *fontname);</programlisting>
- <para>
- Add text at the specified location as a floating selection or a new
- layer.
- </para>
- <para>
- This tool requires font information as a fontname conforming to the
- 'X Logical Font Description Conventions'. You can specify the
- fontsize in units of pixels or points, and the appropriate metric is
- specified using the size_type argument. The x and y parameters
- together control the placement of the new text by specifying the
- upper left corner of the text bounding box. If the antialias
- parameter is non-zero, the generated text will blend more smoothly
- with underlying layers. This option requires more time and memory to
- compute than non-antialiased text; the resulting floating selection
- or layer, however, will require the same amount of memory with or
- without antialiasing. If the specified drawable parameter is valid,
- the text will be created as a floating selection attached to the
- drawable. If the drawable parameter is not valid (-1), the text will
- appear as a new layer. Finally, a border can be specified around the
- final rendered text. The border is measured in pixels. If the border
- is specified as -1, empty spaces around the text will not be
- cropped.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><parameter>drawable_ID</parameter> :</entry>
- <entry> The affected drawable: (-1 for a new text layer).
- </entry></row>
- <row><entry align="right"><parameter>x</parameter> :</entry>
- <entry> The x coordinate for the left of the text bounding box.
- </entry></row>
- <row><entry align="right"><parameter>y</parameter> :</entry>
- <entry> The y coordinate for the top of the text bounding box.
- </entry></row>
- <row><entry align="right"><parameter>text</parameter> :</entry>
- <entry> The text to generate.
- </entry></row>
- <row><entry align="right"><parameter>border</parameter> :</entry>
- <entry> The size of the border.
- </entry></row>
- <row><entry align="right"><parameter>antialias</parameter> :</entry>
- <entry> Antialiasing.
- </entry></row>
- <row><entry align="right"><parameter>size</parameter> :</entry>
- <entry> The size of text in either pixels or points.
- </entry></row>
- <row><entry align="right"><parameter>size_type</parameter> :</entry>
- <entry> The units of specified size.
- </entry></row>
- <row><entry align="right"><parameter>fontname</parameter> :</entry>
- <entry> The fontname (conforming to the X Logical Font Description Conventions).
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The new text layer.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-text-get-extents-fontname">gimp_text_get_extents_fontname ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_text_get_extents_fontname (<link linkend="gchar">gchar</link> *text,
- <link linkend="gdouble">gdouble</link> size,
- <link linkend="GimpSizeType">GimpSizeType</link> size_type,
- <link linkend="gchar">gchar</link> *fontname,
- <link linkend="gint">gint</link> *width,
- <link linkend="gint">gint</link> *height,
- <link linkend="gint">gint</link> *ascent,
- <link linkend="gint">gint</link> *descent);</programlisting>
- <para>
- Get extents of the bounding box for the specified text.
- </para>
- <para>
- This tool returns the width and height of a bounding box for the
- specified text string with the specified font information. Ascent
- and descent for the specified font are returned as well.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>text</parameter> :</entry>
- <entry> The text to generate.
- </entry></row>
- <row><entry align="right"><parameter>size</parameter> :</entry>
- <entry> The size of text in either pixels or points.
- </entry></row>
- <row><entry align="right"><parameter>size_type</parameter> :</entry>
- <entry> The units of specified size.
- </entry></row>
- <row><entry align="right"><parameter>fontname</parameter> :</entry>
- <entry> The fontname (conforming to the X Logical Font Description Conventions).
- </entry></row>
- <row><entry align="right"><parameter>width</parameter> :</entry>
- <entry> The width of the specified font.
- </entry></row>
- <row><entry align="right"><parameter>height</parameter> :</entry>
- <entry> The height of the specified font.
- </entry></row>
- <row><entry align="right"><parameter>ascent</parameter> :</entry>
- <entry> The ascent of the specified font.
- </entry></row>
- <row><entry align="right"><parameter>descent</parameter> :</entry>
- <entry> The descent of the specified font.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-text">gimp_text ()</title>
- <programlisting><link linkend="gint32">gint32</link> gimp_text (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint32">gint32</link> drawable_ID,
- <link linkend="gdouble">gdouble</link> x,
- <link linkend="gdouble">gdouble</link> y,
- <link linkend="gchar">gchar</link> *text,
- <link linkend="gint">gint</link> border,
- <link linkend="gboolean">gboolean</link> antialias,
- <link linkend="gdouble">gdouble</link> size,
- <link linkend="GimpSizeType">GimpSizeType</link> size_type,
- <link linkend="gchar">gchar</link> *foundry,
- <link linkend="gchar">gchar</link> *family,
- <link linkend="gchar">gchar</link> *weight,
- <link linkend="gchar">gchar</link> *slant,
- <link linkend="gchar">gchar</link> *set_width,
- <link linkend="gchar">gchar</link> *spacing,
- <link linkend="gchar">gchar</link> *registry,
- <link linkend="gchar">gchar</link> *encoding);</programlisting>
- <para>
- Add text at the specified location as a floating selection or a new
- layer.
- </para>
- <para>
- This tool requires font information in the form of nine parameters:
- size, foundry, family, weight, slant, set_width, spacing, registry,
- encoding. The font size can either be specified in units of pixels
- or points, and the appropriate metric is specified using the
- size_type argument. The x and y parameters together control the
- placement of the new text by specifying the upper left corner of the
- text bounding box. If the antialias parameter is non-zero, the
- generated text will blend more smoothly with underlying layers. This
- option requires more time and memory to compute than non-antialiased
- text; the resulting floating selection or layer, however, will
- require the same amount of memory with or without antialiasing. If
- the specified drawable parameter is valid, the text will be created
- as a floating selection attached to the drawable. If the drawable
- parameter is not valid (-1), the text will appear as a new layer.
- Finally, a border can be specified around the final rendered text.
- The border is measured in pixels. If the border is specified as -1,
- empty spaces around the text will not be cropped.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><parameter>drawable_ID</parameter> :</entry>
- <entry> The affected drawable: (-1 for a new text layer).
- </entry></row>
- <row><entry align="right"><parameter>x</parameter> :</entry>
- <entry> The x coordinate for the left of the text bounding box.
- </entry></row>
- <row><entry align="right"><parameter>y</parameter> :</entry>
- <entry> The y coordinate for the top of the text bounding box.
- </entry></row>
- <row><entry align="right"><parameter>text</parameter> :</entry>
- <entry> The text to generate.
- </entry></row>
- <row><entry align="right"><parameter>border</parameter> :</entry>
- <entry> The size of the border.
- </entry></row>
- <row><entry align="right"><parameter>antialias</parameter> :</entry>
- <entry> Antialiasing.
- </entry></row>
- <row><entry align="right"><parameter>size</parameter> :</entry>
- <entry> The size of text in either pixels or points.
- </entry></row>
- <row><entry align="right"><parameter>size_type</parameter> :</entry>
- <entry> The units of specified size.
- </entry></row>
- <row><entry align="right"><parameter>foundry</parameter> :</entry>
- <entry> The font foundry, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>family</parameter> :</entry>
- <entry> The font family, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>weight</parameter> :</entry>
- <entry> The font weight, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>slant</parameter> :</entry>
- <entry> The font slant, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>set_width</parameter> :</entry>
- <entry> The font set-width, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>spacing</parameter> :</entry>
- <entry> The font spacing, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>registry</parameter> :</entry>
- <entry> The font registry, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>encoding</parameter> :</entry>
- <entry> The font encoding, \"*\" for any.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The new text layer.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-text-get-extents">gimp_text_get_extents ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_text_get_extents (<link linkend="gchar">gchar</link> *text,
- <link linkend="gdouble">gdouble</link> size,
- <link linkend="GimpSizeType">GimpSizeType</link> size_type,
- <link linkend="gchar">gchar</link> *foundry,
- <link linkend="gchar">gchar</link> *family,
- <link linkend="gchar">gchar</link> *weight,
- <link linkend="gchar">gchar</link> *slant,
- <link linkend="gchar">gchar</link> *set_width,
- <link linkend="gchar">gchar</link> *spacing,
- <link linkend="gchar">gchar</link> *registry,
- <link linkend="gchar">gchar</link> *encoding,
- <link linkend="gint">gint</link> *width,
- <link linkend="gint">gint</link> *height,
- <link linkend="gint">gint</link> *ascent,
- <link linkend="gint">gint</link> *descent);</programlisting>
- <para>
- Get extents of the bounding box for the specified text.
- </para>
- <para>
- This tool returns the width and height of a bounding box for the
- specified text string with the specified font information. Ascent
- and descent for the specified font are returned as well.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>text</parameter> :</entry>
- <entry> The text to generate.
- </entry></row>
- <row><entry align="right"><parameter>size</parameter> :</entry>
- <entry> The size of text in either pixels or points.
- </entry></row>
- <row><entry align="right"><parameter>size_type</parameter> :</entry>
- <entry> The units of specified size.
- </entry></row>
- <row><entry align="right"><parameter>foundry</parameter> :</entry>
- <entry> The font foundry, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>family</parameter> :</entry>
- <entry> The font family, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>weight</parameter> :</entry>
- <entry> The font weight, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>slant</parameter> :</entry>
- <entry> The font slant, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>set_width</parameter> :</entry>
- <entry> The font set-width, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>spacing</parameter> :</entry>
- <entry> The font spacing, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>registry</parameter> :</entry>
- <entry> The font registry, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>encoding</parameter> :</entry>
- <entry> The font encoding, \"*\" for any.
- </entry></row>
- <row><entry align="right"><parameter>width</parameter> :</entry>
- <entry> The width of the specified font.
- </entry></row>
- <row><entry align="right"><parameter>height</parameter> :</entry>
- <entry> The height of the specified font.
- </entry></row>
- <row><entry align="right"><parameter>ascent</parameter> :</entry>
- <entry> The ascent of the specified font.
- </entry></row>
- <row><entry align="right"><parameter>descent</parameter> :</entry>
- <entry> The descent of the specified font.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
-
- </refsect1>
-
-
-
-
- </refentry>
-